//
// Created by 29122 on 2021/3/8.
//

#include "stdio.h"
#include "stdbool.h"
#include "stdlib.h"


#define InitSize 10


typedef struct {
    int *date;
    int MaxSize,length;
}SqList;

void InitList(SqList *sqList){
    sqList->date = (int *)malloc(sizeof(int)* InitSize);
    sqList->length=0;

}

bool install(SqList *sqList,int i,int e){
    if(i<1||i>sqList->length+1)
        return false;
    if(sqList->length>=sqList->MaxSize)
        return false;
    for(int j=sqList->length;j>=i;j--)
        sqList->date[j] = sqList->date[j-1];
    sqList->date[i-1] = e;
    sqList->length++;
    return true;

}

bool delete(SqList *sqList,int i,int e){
    if(i<1||i>sqList->length)
        return false;
    e = sqList->date[i-1];
    for(int j=i;j<sqList->length;j++)
        sqList->date[j-1]=sqList->date[j];
    sqList->length--;
    return true;
}

//删除相同的元素
void deleteRepetition(SqList *L){
    int j =0;
    for(int i=1;i<L->length;i++){
        if(L->date[j]!=L->date[i]){
            L->date[++j]=L->date[i];
        }
    }
    L->length=j+1;
}

int get(SqList *sqList,int e){
    for(int i=0;i<sqList->length;i++)
        if(sqList->date[i]==e)
            return i+1;
    return 0;
}

void main(){
    SqList sqList;
    InitList(&sqList);
    int o;
    for (int i = 1; i <6 ; i++) {
        scanf("%d",&o);
//        int s = rand()% 10;
        install(&sqList,i,o);
    }
//    install(&sqList,1,8);
    deleteRepetition(&sqList);
    for(int k=0;k<sqList.length;k++){
        printf("%d,",sqList.date[k]);
    }


//    printf("list=%d",sqList.date[0]);
}